*
* Returns non-zero on failure.
*/
- int bvt_alloc_task(struct exec_domain *ed)
-static int bvt_alloc_task(struct domain *d)
++static int bvt_alloc_task(struct exec_domain *ed)
{
- if ( (d->sched_priv = xmem_cache_alloc(dom_info_cache)) == NULL )
- return -1;
- memset(d->sched_priv, 0, sizeof(struct bvt_dom_info));
+ struct domain *d = ed->domain;
+ if ( (d->sched_priv == NULL) ) {
+ if ( (d->sched_priv = xmalloc(struct bvt_dom_info)) == NULL )
+ return -1;
+ memset(d->sched_priv, 0, sizeof(struct bvt_dom_info));
+ }
+ ed->ed_sched_priv = &BVT_INFO(d)->ed_inf[ed->eid];
+ BVT_INFO(d)->ed_inf[ed->eid].inf = BVT_INFO(d);
+ BVT_INFO(d)->ed_inf[ed->eid].exec_domain = ed;
return 0;
}
/*
* Add and remove a domain
*/
- void bvt_add_task(struct exec_domain *d)
-static void bvt_add_task(struct domain *d)
++static void bvt_add_task(struct exec_domain *d)
{
- struct bvt_dom_info *inf = BVT_INFO(d);
+ struct bvt_dom_info *inf = BVT_INFO(d->domain);
+ struct bvt_edom_info *einf = EBVT_INFO(d);
ASSERT(inf != NULL);
ASSERT(d != NULL);
}
}
- int bvt_init_idle_task(struct exec_domain *p)
-static int bvt_init_idle_task(struct domain *p)
++static int bvt_init_idle_task(struct exec_domain *p)
{
if ( bvt_alloc_task(p) < 0 )
return -1;
return 0;
}
- void bvt_wake(struct exec_domain *d)
-static void bvt_wake(struct domain *d)
++static void bvt_wake(struct exec_domain *d)
{
- struct bvt_dom_info *inf = BVT_INFO(d);
- struct domain *curr;
+ struct bvt_edom_info *einf = EBVT_INFO(d);
+ struct exec_domain *curr;
s_time_t now, r_time;
int cpu = d->processor;
u32 curr_evt;
* bvt_free_task - free BVT private structures for a task
* @d: task
*/
- void bvt_free_task(struct domain *d)
+ static void bvt_free_task(struct domain *d)
{
ASSERT(d->sched_priv != NULL);
- xmem_cache_free(dom_info_cache, d->sched_priv);
+ xfree(d->sched_priv);
}
/* Control the scheduler. */